var path = require('path')

//sequelize
const Sequelize = require('sequelize')
const sequelize = new Sequelize('platform', 'root', 'root', {
    'dialect': 'mysql',
    'host': 'localhost',
    'port': 3306,
    pool: {
        max: 5,
        min: 0,
        idle: 10000
    },
    timezone: '+08:00' //解决时差
})
sequelize.authenticate().then(() => {
    console.log('sequelize连接成功')
}).catch(err => {
    console.log('sequelize连接失败')
})

module.exports = {
    uploadDir: path.join(__dirname, '../public/upload'),
    Sequelize,
    sequelize
}